package com.zzu.base.common.enums;

import lombok.Getter;

@Getter
public enum ResultStatusEnum {
    SUCCESS(200, "请求处理成功"),
    CREATED(201, "资源创建成功"),
    ACCEPTED(202, "请求已接受，但处理未完成"),
    NO_CONTENT(204, "请求处理成功，但无返回内容"),
    PARTIAL_CONTENT(206, "部分内容"),

    MOVED_PERMANENTLY(301, "永久重定向"),
    FOUND(302, "临时重定向"),
    SEE_OTHER(303, "查看其他位置"),
    NOT_MODIFIED(304, "资源未修改，使用缓存"),
    TEMPORARY_REDIRECT(307, "临时重定向（保持请求方法）"),
    PERMANENT_REDIRECT(308, "永久重定向（保持请求方法）"),

    BAD_REQUEST(400, "错误请求，参数或语法有误"),
    UNAUTHORIZED(401, "用户认证失败"),
    FORBIDDEN(403, "权限不足"),
    NOT_FOUND(404, "请求的资源不存在"),
    METHOD_NOT_ALLOWED(405, "请求方法不允许"),
    NOT_ACCEPTABLE(406, "服务器无法提供请求的内容格式"),
    PROXY_AUTHENTICATION_REQUIRED(407, "需要代理服务器认证"),
    REQUEST_TIMEOUT(408, "请求超时"),
    CONFLICT(409, "请求与服务器当前状态冲突"),
    GONE(410, "资源已永久删除"),
    LENGTH_REQUIRED(411, "需要Content-Length头"),
    PRECONDITION_FAILED(412, "请求前提条件不满足"),
    PAYLOAD_TOO_LARGE(413, "请求体过大"),
    URI_TOO_LONG(414, "URI过长"),
    UNSUPPORTED_MEDIA_TYPE(415, "不支持的媒体类型"),
    RANGE_NOT_SATISFIABLE(416, "请求的范围无法满足"),
    EXPECTATION_FAILED(417, "期望失败"),
    IM_A_TEAPOT(418, "我是一个茶壶"), // 愚人节玩笑状态码
    MISDIRECTED_REQUEST(421, "请求被误导"),
    UNPROCESSABLE_ENTITY(422, "无法处理的实体"),
    LOCKED(423, "资源被锁定"),
    FAILED_DEPENDENCY(424, "依赖项失败"),
    TOO_EARLY(425, "请求过早"),
    UPGRADE_REQUIRED(426, "需要升级协议"),
    PRECONDITION_REQUIRED(428, "需要先决条件"),
    TOO_MANY_REQUESTS(429, "请求过于频繁"),
    REQUEST_HEADER_FIELDS_TOO_LARGE(431, "请求头字段过大"),
    UNAVAILABLE_FOR_LEGAL_REASONS(451, "因法律原因不可用"),

    INTERNAL_SERVER_ERROR(500, "服务器去旅行了，请稍后重试"),
    NOT_IMPLEMENTED(501, "服务器不支持该请求功能"),
    BAD_GATEWAY(502, "网关错误"),
    SERVICE_UNAVAILABLE(503, "服务暂时不可用"),
    GATEWAY_TIMEOUT(504, "网关超时"),
    HTTP_VERSION_NOT_SUPPORTED(505, "不支持的HTTP版本"),
    VARIANT_ALSO_NEGOTIATES(506, "内容协商失败"),
    INSUFFICIENT_STORAGE(507, "存储空间不足"),
    LOOP_DETECTED(508, "检测到循环"),
    NOT_EXTENDED(510, "未扩展"),
    NETWORK_AUTHENTICATION_REQUIRED(511, "需要网络认证");
    public final   Integer code;
    public final String message;

    ResultStatusEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}
